%%% -------------------------------------------------------------------
%%% Author  : vivimice
%%% Description :
%%%
%%% Created : Feb 16, 2012
%%% -------------------------------------------------------------------
-module(service_supervisor).

-behaviour(supervisor).
%% --------------------------------------------------------------------
%% Include files
%% --------------------------------------------------------------------

%% --------------------------------------------------------------------
%% External exports
%% --------------------------------------------------------------------
-export([start_link/1]).

%% --------------------------------------------------------------------
%% Internal exports
%% --------------------------------------------------------------------
-export([init/1]).

%% --------------------------------------------------------------------
%% Macros
%% --------------------------------------------------------------------
-define(SERVER, ?MODULE).

%% --------------------------------------------------------------------
%% Records
%% --------------------------------------------------------------------

%% ====================================================================
%% External functions
%% ====================================================================
start_link(EredisClient) ->
	supervisor:start_link(?MODULE, [EredisClient]).

%% ====================================================================
%% Server functions
%% ====================================================================
%% --------------------------------------------------------------------
%% Func: init/1
%% Returns: {ok,  {SupFlags,  [ChildSpec]}} |
%%          ignore                          |
%%          {error, Reason}
%% --------------------------------------------------------------------
init([EredisClient]) ->
    UserService = {user_service, 
				   {user_service, start_link, [EredisClient]},
				   permanent, 2000, worker, [user_service]},
    {ok, {{one_for_one, 0, 1}, [UserService]}}.

%% ====================================================================
%% Internal functions
%% ====================================================================

